import {
  IsString,
  MinLength,
  MaxLength,
  IsOptional,
  IsEmail,
} from "class-validator";
import { ApiPropertyOptional } from "@nestjs/swagger";

export class EditAccountByOwnDto {
  @IsOptional()
  @ApiPropertyOptional({ description: "初始密码" })
  @MinLength(6, { message: "password长度至少6" })
  @IsString({ message: "password不是有效的数据" })
  password: string;

  @IsOptional()
  @ApiPropertyOptional({ description: "手机号码" })
  @MinLength(11, { message: "phone长度不符" })
  @MaxLength(11, { message: "phone长度不符" })
  @IsString({ message: "phone不是有效的数据" })
  phone: string;

  @IsOptional()
  @ApiPropertyOptional({ description: "邮箱" })
  @IsEmail()
  email: string;
}
